package com.aliyun.oss;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(AliYunOSSProperty.class)
public class AliOSSAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean(AliYunOSSClient.class)
    public AliYunOSSClient aliYunOSSClient(AliYunOSSProperty aliYunOSSProperty) {
        return new AliYunOSSClient(aliYunOSSProperty);
    }
}
